<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="{$Think.__PUBLIC__}css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="{$Think.__PUBLIC__}css/style.css">
<link rel="stylesheet" type="text/css" href="{$Think.__PUBLIC__}css/font-awesome.min.css">
<script src="{$Think.__PUBLIC__}js/jquery-2.1.4.min.js"></script>
<!--[if gte IE 9]>
  <script src="{$Think.__PUBLIC__}js/jquery-1.11.1.min.js" type="text/javascript"></script>
  <script src="{$Think.__PUBLIC__}js/html5shiv.min.js" type="text/javascript"></script>
  <script src="{$Think.__PUBLIC__}js/respond.min.js" type="text/javascript"></script>
  <script src="{$Think.__PUBLIC__}js/selectivizr-min.js" type="text/javascript"></script>
<![endif]-->
<!--[if lt IE 9]>
  <script>window.location.href='upgrade-browser.html';</script>
<![endif]-->
  <style>
    .active207{
      color: #fff;
      background-color: #3399CC;
    }
  </style>
</head>

<body class="user-select">
{include file="/public/header"}
<section class="container-fluid">
  <div class="row">
{include file="/public/row"}
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main">
        <h3>新增商务人员</h3>
        <ol class="breadcrumb">
                <input type="text" id="name" name="name" placeholder="商务姓名">
                <input type="submit" class="btn btn-primary" id="shanchu" value="新增">
        </ol>
        <div class="table-responsive">
          <table class="table table-striped table-hover">
            <thead>
              <tr>
                <th><span class="glyphicon glyphicon-file"></span> <span class="visible-lg">商务姓名</span></th>
                <th><span class="glyphicon glyphicon-file"></span> <span class="visible-lg">url</span></th>
                <th><span class="glyphicon glyphicon-file"></span> <span class="visible-lg">添加时间</span></th>
              </tr>
            </thead>
            <tbody>
            {volist name="list" id="tick"}
            <tr>
               <td>{$tick.shangwu_name}</td>
               <td>http://wap.yrwang.net/index.html?token={$tick.uuid}</td>
               <td>{$tick.create_time}</td>
            </tr>
            {/volist}
            </tbody>
          </table>
            {$list->render()}
        </div>
    </div>
  </div>
</section>
<!--个人信息模态框-->
{include file="/public/state"}
<script src="{$Think.__PUBLIC__}js/bootstrap.min.js"></script>
<script>
    var dianji = $("#shanchu");
    dianji.click(function() {
        var name = $("#name").val();
        $.ajax({
            type: "get",
            url: "{:url('index/business/add')}",
            data: {"name": name},
            cache: false, //不缓存此页面
            success: function (data) {
                if (data == 0) {
                    alert('新增成功');
                    history.go(0);
                } else if (data ==2){
                    alert('用户已经存在');
                }else{
                    alert('新增失败');
                }
            }
        });
    });
</script>
</body>
</html>
